<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<%
	String path = request.getContextPath();
	// 获得本项目的地址(例如: http://localhost:8080/MyApp/)赋值给basePath变量 
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	// 将 "项目路径basePath" 放入pageContext中，待以后用EL表达式读出。 
	pageContext.setAttribute("basePath", basePath);
	//out.write(basePath);
%>

<!-- Bootstrap core CSS -->
<link href="<%=basePath%>bootstrap3/css/bootstrap.min.css"
	rel="stylesheet">
<link href="data:text/css;charset=utf-8,"
	data-href="<%=basePath%>bootstrap3/css/bootstrap-theme.min.css"
	rel="stylesheet" id="bs-theme-stylesheet">
<link href="<%=basePath%>bootstrap3/css/docs.min.css" rel="stylesheet">

<script src="<%=basePath%>bootstrap3/js/jquery.min.js"></script>

<script src="<%=basePath%>bootstrap3/js/bootstrap.min.js"></script>

<script src="<%=basePath%>bootstrap3/js/docs.min.js"></script>

<script src="<%=basePath%>bootstrap3/js/ie10-viewport-bug-workaround.js"></script>
<style type="text/css">
#add {
	width: 50%;
	height: 600px;
	margin-left: auto;
	margin-right: auto;
}

#heads {
	height: 100px;
	width: 100%;
	background: #B9DEF0;
	margin-left: auto;
	margin-right: auto;
}
</style>

<script type="text/javascript">
	$(function() {
		var addo = $("#modifyInfo")[0].value;
		if (addo != null && addo != "") {
			alert(addo);
		}
	});
	function checkName() {
		//获取用户名输入控件对象的内容
		var txtName = document.getElementById("username").value;
		//信息提示框
		var sptxtName = document.getElementById("spanusername");
		if (txtName == null || txtName == "") {
			//验证失败
			isChecked = false;
			//提示信息					
			sptxtName.innerHTML = "请输入户主名字！";
			sptxtName.style.color = "#B92C28";
			return false;
		} else {
			sptxtName.innerHTML = "";
			//修改标志变量
			return true;
		}
	}

	function checkSex() {
		// 验证性别 是否选择
		// 使用循环验证单选组是否进行了选择
		var radioSex = document.getElementsByName("usersex");
		//遍历所有的单选组件，验证是否进行了选择
		var isChSex = false;
		for (var i = 0; i < radioSex.length; i++) {
			//判定是否进行了选择
			if (radioSex[i].checked) {
				//选择了
				isChSex = true;
				//结束循环
				break;
			}
		}
		//信息提示框
		var sptxtSex = document.getElementById("spanusersex");

		//设置性别验证结果
		if (!isChSex) {
			//错误提示信息
			sptxtSex.innerHTML = "请选择用户的性别！";
			sptxtSex.style.color = "#B92C28";
			return false;
		} else {
			//清空错误提示信息
			sptxtSex.innerHTML = "";
			return true;
		}
	}

	function checkbrity() {

		//密码非空验证
		var txtPsw = document.getElementById("userbrity").value;
		//信息提示框
		var sptxtPsw = document.getElementById("spanuserbrity");
		if (txtPsw == null || txtPsw == "") {

			//错误提示信息
			//提示信息					
			sptxtPsw.innerHTML = "请选择用户的生日！";
			sptxtPsw.style.color = "#B92C28";
			return false;
		} else {
			//验证通过  清空提示内容
			sptxtPsw.innerHTML = "";
			return true;
		}
	}

	function checkuseridcard() {
		//密码非空验证
		var txtPsw = document.getElementById("useridcard").value;

		//信息提示框
		var sptxtPsw = document.getElementById("spanuseridcard");
		if (txtPsw == null || txtPsw == "") {

			//错误提示信息
			//提示信息					
			sptxtPsw.innerHTML = "请输入用户的身份证号码！";
			sptxtPsw.style.color = "#B92C28";
			return false;
		} else {
			//验证通过  清空提示内容
			sptxtPsw.innerHTML = "";
			return true;
		}
	}

	function checkuseradress() {
		//密码非空验证
		var txtPsw = document.getElementById("useradress").value;

		//信息提示框
		var sptxtPsw = document.getElementById("spanuseradress");
		if (txtPsw == null || txtPsw == "") {

			//错误提示信息
			//提示信息					
			sptxtPsw.innerHTML = "请输入用户的地址！";
			sptxtPsw.style.color = "#B92C28";
			return false;
		} else {
			//验证通过  清空提示内容
			sptxtPsw.innerHTML = "";
			return true;
		}
	}

	function checkAll() {
		//用户名验证
		var ischName = checkName();
		//密码验证
		var ischeckSex = checkSex();

		var ischeckbrity = checkbrity();

		var ischeckIdcard = checkuseridcard();

		var ischeckuseradress = checkuseradress();

		if (ischName && ischeckSex && ischeckbrity && ischeckIdcard
				&& ischeckuseradress) {
			//验证通过
			return true;
		} else {
			return false;
		}
	}
</script>
<link rel="stylesheet" type="text/css"
	href="http://www.jeasyui.net/Public/js/easyui/themes/default/easyui.css">
<script type="text/javascript"
	src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
<link rel="stylesheet" type="text/css"
	href="http://www.jeasyui.net/Public/js/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css"
	href="http://www.jeasyui.net/Public/js/easyui/demo/demo.css">
<script type="text/javascript"
	src="http://www.jeasyui.net/Public/js/easyui/jquery.easyui.min.js"></script>
</head>

<body>
	<input type="hidden" id="modifyInfo"
		value="${sessionScope.modifyInfo }">
	<div id="heads">
		<div style="height: 10px;"></div>
		<div
			style="height: 100px; width: 60%; margin-left: auto; margin-right: auto;">
			<h1>
				<span class="glyphicon glyphicon-leaf"></span>&nbsp;&nbsp;&nbsp;&nbsp;用户&nbsp;户&nbsp;信&nbsp;息&nbsp;录&nbsp;入
			</h1>
		</div>
	</div>
	<div style="height: 30px;"></div>
	<form action="<%=basePath%>netuser/modifyInfo.action">
		<input type="hidden" name="userid"
			value="${sessionScope.user.userid }">
		<div id="add">
			<div class="row">
				<div class="col-md-4" align="center">
					<font face="仿宋" size="5">用&nbsp;户</font>
				</div>
				<div class="col-md-5">
					<input type="text" class="form-control" id="username"
						name="username" placeholder="请输入用户名" onblur="checkName();"
						value="${sessionScope.user.username }" style="height: 40px;">
				</div>
				<div class="col-md-3">
					<span id="spanusername"></span>
				</div>
			</div>

			<hr />
			<div class="row">
				<div class="col-md-4" align="center">
					<font face="仿宋" size="5">性&nbsp;别</font>
				</div>
				<div class="col-md-5">
					<div class=" col-md-6">
						<label> <input type="radio" name="usersex" id="usersex"
							value="男"
							<c:if test="${sessionScope.user.usersex =='男' }">checked</c:if>>
							男
						</label>
					</div>
					<div class=" col-md-6">
						<label> <input type="radio" name="usersex" id="usersex"
							value="女"
							<c:if test="${sessionScope.user.usersex =='女' }">checked</c:if>>
							女
						</label>
					</div>
				</div>
				<div class="col-md-3">
					<span id="spanusersex"></span>
				</div>
			</div>
			<hr />
			<div class="row">
				<div class="col-md-4" align="center">
					<font face="仿宋" size="5">生&nbsp;日</font>
				</div>
				<div class="col-md-5">
					<input class="easyui-datebox" id="userbrity" name="userbrity"
						style="height: 40px; width: 280px;" value='<fmt:formatDate value="${sessionScope.user.userbrity }" pattern="MM/dd/yyyy"/>'>
				</div>
				<div class="col-md-3">
					<span id="spanuserbrity" style="height: 50px;"></span>
				</div>
			</div>
			<hr />
			<div class="row">
				<div class="col-md-4" align="center">
					<font face="仿宋" size="5">身&nbsp;份</font>
				</div>
				<div class="col-md-5">
					<input type="text" class="form-control" id="useridcard"
						name="useridcard" placeholder="请输入您的身份证号"
						value="${sessionScope.user.useridcard}"
						onblur="checkuseridcard();" style="height: 40px;">
				</div>
				<div class="col-md-3">
					<span id="spanuseridcard"></span>
				</div>
			</div>
			<hr />
			<div class="row">
				<div class="col-md-4" align="center">
					<font face="仿宋" size="5">地&nbsp;址</font>
				</div>
				<div class="col-md-5">
					<input type="text" class="form-control" id="useradress"
						name="useradress" placeholder="请输入您的地址"
						onblur="checkuseradress();"
						value="${sessionScope.user.useradress}" style="height: 40px;">
				</div>
				<div class="col-md-3">
					<span id="spanuseradress"></span>
				</div>
			</div>
			<hr />
			<div class="row">
				<div class="col-sm-offset-2 col-md-2">
					<button type="submit" class="btn btn-default" onclick="checkAll();"
						style="height: 40px; width: 150px;">&nbsp;提&nbsp;&nbsp;&nbsp;交&nbsp;</button>
				</div>
				<div class="col-sm-offset-2 col-md-4">
					<button type="reset" class="btn btn-default"
						style="height: 40px; width: 150px;">&nbsp;重&nbsp;&nbsp;&nbsp;置&nbsp;</button>
				</div>
			</div>
		</div>
	</form>
</body>

</html>